package com.zrw.sms.service.impl;

import com.zrw.sms.domain.SmsCustomerApp;
import com.zrw.sms.mapper.SmsCustomerAppMapper;
import com.zrw.sms.service.ISmsCustomerAppService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * 参数配置 服务层实现
 * 
 * @author ruoyi
 */
@RequiredArgsConstructor
@Service
public class SmsCustomerAppServiceImpl implements ISmsCustomerAppService
{
    private final SmsCustomerAppMapper customerAppMapper;


    /**
     * 查询app信息
     *
     * @param appId appID
     * @return app信息
     */
    @Override
    public SmsCustomerApp selectCustomerAppById(Long appId) {
        return customerAppMapper.selectById(appId);
    }

    /**
     * 查询app列表
     *
     * @param app app信息
     * @return app集合
     */
    @Override
    public List<SmsCustomerApp> selectAppList(SmsCustomerApp app) {
        return customerAppMapper.selectList(null);
    }

    /**
     * 新增app
     *
     * @param app app信息
     * @return 结果
     */
    @Override
    public int insertCustomerApp(SmsCustomerApp app) {
        return customerAppMapper.insert(app);
    }

    /**
     * 修改app
     *
     * @param app app信息
     * @return 结果
     */
    @Override
    public int updateCustomerApp(SmsCustomerApp app) {
        return customerAppMapper.updateById(app);
    }

    /**
     * 删除app对象
     *
     * @param appId appID
     * @return 结果
     */
    @Override
    public int deleteCustomerAppById(Long appId) {
        return customerAppMapper.deleteById(appId);
    }

    /**
     * 批量删除app信息
     *
     * @param appIds 需要删除的appID
     * @return 结果
     */
    @Override
    public int deleteCustomerAppByIds(Long[] appIds) {
        if (appIds.length < 1 ) {
            return 0;
        }
        return customerAppMapper.deleteByIds(Arrays.asList(appIds));
    }
}
